package com.util.net

class GetUrlContent {
	
	static main(args) {
		saveUrl("http://duoding.com","c://duoding.html")
	}
	
 
	def static saveUrl(def url,def path){
		//def url = "http://www.baidu.com"
		def writer = new BufferedWriter(new FileWriter(path))
		
		url.toURL().eachLine{line-> writer << line }
		
		writer.flush()
		writer.close()
	}
}
